package com.ifcreate.infowell.common.exception;


import com.ifcreate.infowell.common.util.JsonResult;

/**
 * @Author EddyChen
 * @Email 835033913@qq.com
 * @Create 2019/8/19 11:31
 */
public class CustomException extends RuntimeException {

    private static final int ERROR_CODE = 400;

    private int errorCode = ERROR_CODE;

    public CustomException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public CustomException(String message) {
        super(message);
        this.errorCode = ERROR_CODE;
    }

    public CustomException() {
        super(JsonResult.actionFailure().getErrorMessage());
        this.errorCode = ERROR_CODE;
    }

    public int getErrorCode() {
        return errorCode;
    }
}
